package main.java.com.fxy.service.impl;

import main.java.com.fxy.dao.CostDao;
import main.java.com.fxy.dao.impl.CostDaoImpl;
import main.java.com.fxy.pojo.Cost;
import main.java.com.fxy.service.CostService;

import java.util.List;

public class CostServiceImpl implements CostService {
    private CostDao costDao = new CostDaoImpl();

    @Override
    public Integer getIdByName(String user) {
        return costDao.getIdByName(user);
    }

    @Override
    public Cost getCostById(int id) {
        return costDao.getCostById(id);
    }

    @Override
    public List<Cost> list(Integer id) {
        return costDao.list(id);
    }

    @Override
    public List<Cost> query(String keyword, Integer id) {
        return costDao.query(keyword,id);
    }

    @Override
    public void update(Cost cost) {
        costDao.update(cost);
    }

    @Override
    public void deleteById(Integer id) {
        costDao.deleteById(id);
    }

    @Override
    public void addCost(Cost cost) {
        costDao.addCost(cost);
    }
}
